package com.github.yangyishe.p500.p427;

public class Node {
    public boolean val;
    public boolean isLeaf;
    public Node topLeft;
    public Node topRight;
    public Node bottomLeft;
    public Node bottomRight;

    @Override
    public String toString() {
        return "{" +
                "val=" + val +
                ", isLeaf=" + isLeaf +
                '}';
    }

    public void printSingle(Node node){
        if(node==null){
            System.out.println(node);
        }else{
            node.print();
        }
    }

    public void print(){
//        System.out.println("["+(val?1:0)+","+(isLeaf?1:0)+"],");
        System.out.println(this);
        printSingle(topLeft);
        printSingle(topRight);
        printSingle(bottomLeft);
        printSingle(bottomRight);
    }
}
